<template>
    <Layout>
        <Form ref="form1" :model="queryParam" :label-width="120">
            <Row :gutter="16" class="query-form2" v-show="!switchFlag">
                <Col span="8">
                    <FormItem label="项目名称：" prop="projectName">
                        <Input class="query-form-el" type="text" v-model="queryParam.projectName"></Input>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="责任单位：">
                        <Input class="query-form-el" type="text" v-model="queryParam.dutyOrgName"></Input>
                    </FormItem>
                </Col>
                <Col span="8">
                    <div style="float: right;">
                        <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                        <Button class="ivu-btn-reset" style="margin-left: 10px" @click="cancel">重置</Button>
                        <Button @click="switchQuery(true)" style="margin-left: 10px" class="ivu-btn-switch2" type="text" >展开<Icon type="ios-arrow-down"/></Button>
                    </div>
                </Col>
            </Row>
            <Row v-show="switchFlag" class="query-form">
                <Col span="8">
                    <FormItem label="项目名称：" prop="projectName">
                        <Input class="query-form-el" type="text" v-model="queryParam.projectName"></Input>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="责任单位：" prop="dutyOrgName">
                        <Input class="query-form-el" type="text" v-model="queryParam.dutyOrgName"></Input>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label="项目性质：">
                        <Select v-model="queryParam.projectNature">
                            <Option v-for="item in projectNatureMaps" :value="item.codingCodeId" :key="item.codingCodeId">
                                {{item.codingName}}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
            </Row>
            <Row v-show="switchFlag" class="query-form">
                <Col span="8">
                    <FormItem label="项目级别：">
                        <Select v-model="queryParam.projectLevel">
                            <Option v-for="item in projectLevelMaps" :value="item.codingCodeId" :key="item.codingCodeId">
                                {{item.codingName}}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col span="8">
                </Col>
                <Col span="8">
                    <Button @click="switchQuery(false)" class="ivu-btn-switch" type="text">收起∧</Button>
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
            </Row>
        </Form>
        <Row class="query-form">
            <Col span="24">
                <Tooltip  content="请先选择项目"  :disabled="Object.keys(selectedInfo).length!=0"  placement="top">
                <Button size="large" :loading="environmentalLoading" :disabled="Object.keys(selectedInfo).length==0"
                    v-if="Object.keys(selectedInfo).length==0||selectedInfo.isEnvironmental=='1'"
                    class="ivu-btn-add"  @click="queryEnvironmentalProcess(true)">环保水保过程管理</Button>
                </Tooltip>
                <Tooltip  content="请先选择项目"  :disabled="Object.keys(selectedInfo).length!=0"  placement="top">
                <Button size="large" :loading="healthLoading" :disabled="Object.keys(selectedInfo).length==0"
                    v-if="Object.keys(selectedInfo).length==0||selectedInfo.isHealth=='1'"
                    class="ivu-btn-add"  @click="queryHealthProcess(true)">职业卫生过程管理</Button>
                </Tooltip>
                <Tooltip  content="请先选择项目"  :disabled="Object.keys(selectedInfo).length!=0"  placement="top">
                <Button size="large" :loading="safeLoading" :disabled="Object.keys(selectedInfo).length==0"
                    v-if="Object.keys(selectedInfo).length==0||selectedInfo.isSafe=='1'"
                    class="ivu-btn-add"  @click="querySafeProcess(true)">安全过程管理</Button>
                </Tooltip>
                <Tooltip  content="请先选择项目"  :disabled="Object.keys(selectedInfo).length!=0"  placement="top">
                <Button size="large" :loading="energyLoading" :disabled="Object.keys(selectedInfo).length==0"
                    v-if="Object.keys(selectedInfo).length==0||selectedInfo.isEnergy=='1'"
                    class="ivu-btn-add"  @click="queryEnergyProcess(true)">节能评估过程管理</Button>
                </Tooltip>
                <Tooltip  content="请先选择项目"  :disabled="Object.keys(selectedInfo).length!=0"  placement="top">
                <Button size="large" :loading="fireLoading" :disabled="Object.keys(selectedInfo).length==0"
                    v-if="Object.keys(selectedInfo).length==0||selectedInfo.isFire=='1'"
                    class="ivu-btn-add"  @click="queryFireProcess(true)">消防过程管理</Button>
                </Tooltip>
            </Col>
        </Row>

        <Table ref='table' highlight-row :height="tableHeight" :loading="loading"
               border  :columns="columns1" :data="dataTable">
        </Table>

        <Row style="margin-right:10px;">
            <Col span="24">
                <Page style="float: right" :total="pagedata.total" :page-size="pagedata.pageSize"
                      @on-change="pageChange" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray"
                      show-total show-sizer show-elevator/>
            </Col>
        </Row>

        
        <Modal title="过程管理" :transfer=false v-model="environmentalVisible" :width=1200 
            class-name='limit-height-dialog' :styles="{height:'520px'}" @on-cancel="onCancel">
            <Row>
                <Col span="24">
                    <Form  ref="threeSimEnvironmentalProcessData" :model="threeSimEnvironmentalProcessData" :rules="ruleCustom" label-position="top">
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                            <label style="font-weight:900;font-size:16px">过程资料</label>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                        <br>
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label="环保水保过程文件">
                                    <div>
                                        <Upload ref="upload"
                                                :before-upload="beforeUploadEnvironmental"
                                                :show-upload-list="true"
                                                :max-size="10240"
                                                multiple
                                                type="drag"
                                                :action="fileUrl">
                                        <div style="padding: 10px">
                                            <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                                            <p>点击将文件拖拽到这里上传</p>
                                            <span style="font-size:8px;color: #797a64">支持扩展名：.rar .zip .doc .docx .pdf...</span>
                                        </div>
                                        </Upload>
                                    </div>
                                    <div v-show="environmentalProcessFiles.length>0" v-for="(item,index) in environmentalProcessFiles" :key='item'>
                                        <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                        <Button type="text" icon="md-trash" @click="removeEnvironmentalProcessFile(item.fileId)"
                                                style="margin-left: 5px;margin-bottom: 3px"/>
                                    </div>
                                </FormItem>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>           
            <div slot="footer">
                <Button @click="onCancel" class="ivu-btn-save" :loading="buttonLoading">确定</Button>
            </div>
        </Modal>

        <Modal title="过程管理" :transfer=false v-model="healthVisible" :width=1200 
            class-name='limit-height-dialog' :styles="{height:'520px'}" @on-cancel="onCancel">
            <Row>
                <Col span="24">
                    <Form  ref="threeSimHealthProcessData" :model="threeSimHealthProcessData" :rules="ruleCustom" label-position="top">
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                            <label style="font-weight:900;font-size:16px">过程资料</label>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                        <br>
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label="职业卫生过程文件">
                                    <div>
                                        <Upload ref="upload"
                                                :before-upload="beforeUploadHealth"
                                                :show-upload-list="true"
                                                :max-size="10240"
                                                multiple
                                                type="drag"
                                                :action="fileUrl">
                                        <div style="padding: 10px">
                                            <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                                            <p>点击将文件拖拽到这里上传</p>
                                            <span style="font-size:8px;color: #797a64">支持扩展名：.rar .zip .doc .docx .pdf...</span>
                                        </div>
                                        </Upload>
                                    </div>
                                    <div v-show="healthProcessFiles.length>0" v-for="(item,index) in healthProcessFiles" :key='item'>
                                        <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                        <Button type="text" icon="md-trash" @click="removeHealthProcessFile(item.fileId)"
                                                style="margin-left: 5px;margin-bottom: 3px"/>
                                    </div>
                                </FormItem>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>           
            <div slot="footer">
                <Button @click="onCancel" class="ivu-btn-save" :loading="buttonLoading">确定</Button>
            </div>
        </Modal>

        <Modal title="过程管理" :transfer=false v-model="safeVisible" :width=1200 
            class-name='limit-height-dialog' :styles="{height:'500px'}" @on-cancel="onCancel">
            <Row>
                <Col span="24">
                    <Form  ref="threeSimSafeProcessData" :model="threeSimSafeProcessData" :rules="ruleCustom" label-position="top">
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                            <label style="font-weight:900;font-size:16px">过程资料</label>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                        <br>
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label="安全过程文件">
                                    <div>
                                        <Upload ref="upload"
                                                :before-upload="beforeUploadSafe"
                                                :show-upload-list="true"
                                                :max-size="10240"
                                                multiple
                                                type="drag"
                                                :action="fileUrl">
                                        <div style="padding: 10px">
                                            <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                                            <p>点击将文件拖拽到这里上传</p>
                                            <span style="font-size:8px;color: #797a64">支持扩展名：.rar .zip .doc .docx .pdf...</span>
                                        </div>
                                        </Upload>
                                    </div>
                                    <div v-show="safeProcessFiles.length>0" v-for="(item,index) in safeProcessFiles" :key='item'>
                                        <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                        <Button type="text" icon="md-trash" @click="removeSafeProcessFile(item.fileId)"
                                                style="margin-left: 5px;margin-bottom: 3px"/>
                                    </div>
                                </FormItem>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>           
            <div slot="footer">
                <Button @click="onCancel" class="ivu-btn-save" :loading="buttonLoading">确定</Button>
            </div>
        </Modal>

        <Modal title="过程管理" :transfer=false v-model="energyVisible" :width=1200 
            class-name='limit-height-dialog' :styles="{height:'520px'}" @on-cancel="onCancel">
            <Row>
                <Col span="24">
                    <Form  ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom" label-position="top">
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                            <label style="font-weight:900;font-size:16px">过程资料</label>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                        <br>
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label="节能过程文件">
                                    <div>
                                        <Upload ref="upload"
                                                :before-upload="beforeUploadEnergy"
                                                :show-upload-list="true"
                                                :max-size="10240"
                                                multiple
                                                type="drag"
                                                :action="fileUrl">
                                        <div style="padding: 10px">
                                            <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                                            <p>点击将文件拖拽到这里上传</p>
                                            <span style="font-size:8px;color: #797a64">支持扩展名：.rar .zip .doc .docx .pdf...</span>
                                        </div>
                                        </Upload>
                                    </div>
                                    <div v-show="energyProcessFiles.length>0" v-for="(item,index) in energyProcessFiles" :key='item'>
                                        <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                        <Button type="text" icon="md-trash" @click="removeEnergyProcessFile(item.fileId)"
                                                style="margin-left: 5px;margin-bottom: 3px"/>
                                    </div>
                                </FormItem>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>           
            <div slot="footer">
                <Button @click="onCancel" class="ivu-btn-save" :loading="buttonLoading">确定</Button>
            </div>
        </Modal>

        <Modal title="过程管理" :transfer=false v-model="fireVisible" :width=1200 
            class-name='limit-height-dialog' :styles="{height:'520px'}" @on-cancel="onCancel">
            <Row>
                <Col span="24">
                    <Form  ref="threeSimFireData" :model="threeSimFireData" :rules="ruleCustom" label-position="top">
                        <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label="消防过程文件">
                                    <div>
                                        <Upload ref="upload"
                                                :before-upload="beforeUploadFire"
                                                :show-upload-list="true"
                                                :max-size="10240"
                                                multiple
                                                type="drag"
                                                :action="fileUrl">
                                        <div style="padding: 10px">
                                            <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                                            <p>点击将文件拖拽到这里上传</p>
                                            <span style="font-size:8px;color: #797a64">支持扩展名：.rar .zip .doc .docx .pdf...</span>
                                        </div>
                                        </Upload>
                                    </div>
                                    <div v-show="fireProcessFiles.length>0" v-for="(item,index) in fireProcessFiles" :key='item'>
                                        <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                        <Button type="text" icon="md-trash" @click="removeFireProcessFile(item.fileId)"
                                                style="margin-left: 5px;margin-bottom: 3px"/>
                                    </div>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                
                            </Col>
                        </Row>
                    </Form>
                </Col>
            </Row>           
            <div slot="footer">
                <Button @click="onCancel" class="ivu-btn-save" :loading="buttonLoading">确定</Button>
            </div>
        </Modal>
        
        <Modal :transfer=false v-model="threeSimAccountVisible" :width=1200  class="modal-view-detail" 
           footer-hide  @on-cancel="onCancel"  class-name='limit-height-dialog'>
            <Tabs v-model="tabName">
                <TabPane label="项目基本信息" name="name1" style="height:500px;overflow-x:hidden;overflow-y:auto;">
                    <Row>
                        <Col span="24">
                            <Form :model="showdata" :label-width="150">
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="23">
                                        <FormItem label="项目名称：" prop="projectName">
                                            {{showdata.projectName}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="23">
                                        <FormItem label="项目基本情况：" prop="projectDesc">
                                            {{showdata.projectDesc}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="11">
                                        <FormItem label="责任单位：" prop="dutyOrgId">
                                            {{showdata.dutyOrgName}}
                                        </FormItem>
                                    </Col>
                                    <Col span="11">
                                        <FormItem label="项目设计单位：" prop="designUnit">
                                            {{showdata.designUnit}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="11">
                                        <FormItem label="项目性质：" prop="projectNature">
                                            {{showdata.projectNatureName}}
                                        </FormItem>
                                    </Col>
                                    <Col span="11">
                                        <FormItem label="项目级别：" prop="projectLevel">
                                            {{showdata.projectLevelName}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="11">
                                        <FormItem label="所在行政区域：" prop="administrativeMap">
                                            {{areaCodeToAreaName(showdata.administrativeMap)}}
                                        </FormItem>
                                    </Col>
                                    <Col span="11">
                                        <FormItem label="立项时间：" prop="establishmentTime">
                                            {{showdata.establishmentTimeStr}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="11">
                                        <FormItem label="计划开工时间：" prop="startTime">
                                            {{showdata.startTimeStr}}
                                        </FormItem>
                                    </Col>
                                    <Col span="11">
                                        <FormItem label="计划完工时间：" prop="endTime">
                                            {{showdata.endTimeStr}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="11">
                                        <FormItem label="总投资（万元）：" prop="totalInvestment">
                                            {{showdata.totalInvestment}}
                                        </FormItem>
                                    </Col>
                                    <Col span="11">
                                        <FormItem label="年综合能源消耗量（吨标准煤）：" prop="powerConsumption">
                                            {{showdata.powerConsumption}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="11">
                                        <FormItem label="项目负责人：" prop="projectLeader">
                                            {{showdata.projectLeader}}
                                        </FormItem>
                                    </Col>
                                    <Col span="11">
                                        <FormItem label="联系电话：" prop="contactPhone">
                                            {{showdata.contactPhone}}
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="23">
                                        <FormItem label="三同时类型：" prop="projectType">
                                            <CheckboxGroup v-model="showdata.projectType">
                                                <Checkbox label="1" disabled>环保水保三同时</Checkbox>
                                                <Checkbox label="2" disabled>职业卫生三同时</Checkbox>
                                                <Checkbox label="3" disabled>安全三同时</Checkbox>
                                                <Checkbox label="4" disabled>节能评估三同时</Checkbox>
                                                <Checkbox label="5" disabled>消防三同时</Checkbox>
                                            </CheckboxGroup>
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row type="flex" justify="space-around" class="code-row-bg">
                                    <Col span="23">
                                        <FormItem label="备注：" prop="remark">
                                            {{showdata.remark}}
                                        </FormItem>
                                    </Col>
                                </Row>
                            </Form>
                        </Col>
                    </Row>
                </TabPane>
                <TabPane label="环保水保三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isEnvironmental=='1'" name="name2" style="height:500px;overflow-x:hidden;overflow-y:auto;">
                    <Row>
                        <Col span="24">
                            <Card>
                                <p slot="title">可研设计资料</p>
                                <Form  ref="threeSimEnvironmentalDatas" :model="threeSimEnvironmentalDatas" :rules="ruleCustom" label-position="left">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4">
                                        </Col>
                                        <Col span="4">
                                        编制单位
                                        </Col>
                                        <Col span="4">
                                        批复时间
                                        </Col>
                                        <Col span="4">
                                        批复/备案文号
                                        </Col>
                                        <Col span="4">
                                        初审部门
                                        </Col>
                                        <Col span="4">
                                        审批部门
                                        </Col>
                                    </Row>
                                    <br>
                                    <div v-for="item in threeSimEnvironmentalDatas">
                                        <Row  :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                            <Col span="4">
                                            <label style="float:right">{{item.environmentTypeName}}</label>
                                            </Col>
                                            <Col span="4" >
                                            <Input readonly v-model="item.organizationUnit" type="text"/>
                                            </Col>
                                            <Col span="4">
                                            <DatePicker type="date" placeholder="选择时间" v-model="item.replyTime" />
                                            </Col>
                                            <Col span="4">
                                            <Input readonly v-model="item.recordIcp" type="text"/>
                                            </Col>
                                            <Col span="4">
                                            <Input readonly v-model="item.intitalInvestigationDepartment" type="text"/>
                                            </Col>
                                            <Col span="4">
                                            <Input readonly v-model="item.investigationDepartment" type="text"/>
                                            </Col>
                                            <br>
                                        </Row>
                                        <br>
                                    </div>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4" style="float:right">
                                        <label style="float:right">可研报告：</label>
                                        </Col>
                                        <Col span="17">
                                            <Input readonly type="text" v-model="environmentalDesignFile.fileName">
                                                <Button type="ghost" slot="append" @click="downloadFile(environmentalDesignFile.fileId,environmentalDesignFile.fileName,environmentalDesignFile)">下载</Button>
                                            </Input>
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4" style="float:right">
                                        <label style="float:right">环境影响评价报告：</label>
                                        </Col>
                                        <Col span="17">
                                            <Input readonly type="text" v-model="environmentalInfluenceReportFile.name">
                                                <Button type="ghost" slot="append" @click="downloadFile(environmentalInfluenceReportFile.fileId,environmentalInfluenceReportFile.fileName,environmentalInfluenceReportFile)">下载</Button>
                                            </Input>
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4" style="float:right">
                                        <label style="float:right">环境影响评价批复：</label>
                                        </Col>
                                        <Col span="17">
                                            <Input readonly type="text" v-model="environmentalInfluenceReplyFile.name">
                                                <Button type="ghost" slot="append" @click="downloadFile(environmentalInfluenceReplyFile.fileId,environmentalInfluenceReplyFile.fileName,environmentalInfluenceReplyFile)">下载</Button>
                                            </Input>
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4" style="float:right">
                                        <label style="float:right">水土保持评价报告：</label>
                                        </Col>
                                        <Col span="17">
                                            <Input readonly type="text" v-model="environmentalSoilWaterReportFile.name">
                                                <Button type="ghost" slot="append" @click="downloadFile(environmentalSoilWaterReportFile.fileId,environmentalSoilWaterReportFile.fileName,environmentalSoilWaterReportFile)">下载</Button>
                                            </Input>
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4" style="float:right">
                                        <label style="float:right">水土保持评价批复：</label>
                                        </Col>
                                        <Col span="17">
                                            <Input readonly type="text" v-model="environmentalSoilWaterReplyFile.name">
                                                <Button type="ghost" slot="append" @click="downloadFile(environmentalSoilWaterReplyFile.fileId,environmentalSoilWaterReplyFile.fileName,environmentalSoilWaterReplyFile)">下载</Button>
                                            </Input>
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4">
                                        <label style="float:right">水土保持补偿费缴纳凭证：</label>
                                        </Col>
                                        <Col span="17">
                                            <Input readonly type="text" v-model="environmentalSoilWaterPayProofFile.name">
                                                <Button type="ghost" slot="append" @click="downloadFile(environmentalSoilWaterPayProofFile.fileId,environmentalSoilWaterPayProofFile.fileName,environmentalSoilWaterPayProofFile)">下载</Button>
                                            </Input>
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4">
                                        <label style="float:right">水土保持地方政府批复：</label>
                                        </Col>
                                        <Col span="17">
                                            <Input readonly type="text" v-model="environmentalSoilWaterGovermentReplyFile.name">
                                                <Button type="ghost" slot="append" @click="downloadFile(environmentalSoilWaterGovermentReplyFile.fileId,environmentalSoilWaterGovermentReplyFile.fileName,environmentalSoilWaterGovermentReplyFile)">下载</Button>
                                            </Input>
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="4">
                                        <label style="float:right">备注：</label>    
                                        </Col>
                                        <Col span="19">       
                                            <Input readonly v-model="threeSimEnvironmentalDatas[0].remark" type="textarea"/>
                                        </Col>
                                        <Col span="1"></Col>
                                    </Row>
                                </Form>
                            </Card>
                            <Card>
                                <p slot="title">过程管理</p>
                                <Form  ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="环保水保过程文件">
                                                <div v-show="environmentalProcessFiles.length>0" v-for="(item,index) in environmentalProcessFiles" :key='item'>
                                                    <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                                </div> 
                                            </FormItem>
                                        </Col>
                                        <Col span="11"></Col>
                                    </Row>
                                </Form>
                            </Card>
                        </Col>
                    </Row>
                </TabPane>
                <TabPane label="职业卫生三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isHealth=='1'" name="name3" style="height:500px;overflow-x:hidden;overflow-y:auto;">
                    <Row>
                        <Col span="24">
                            <Card>
                                <p slot="title">可研设计资料</p>
                                <Form  ref="threeSimHealthData" :model="threeSimHealthData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="评价单位">
                                                <Input readonly type="text" v-model="threeSimHealthData.evaluateUnit"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="主要职业病危害因素">
                                                <Input readonly type="text" v-model="threeSimHealthData.hazardFactors"/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="职业病危险因素影响程度">
                                                <Input readonly type="text" v-model="threeSimHealthData.influenceLevel"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="职业病防护专项投资预算（万元）">
                                                <Input readonly type="text" v-model="threeSimHealthData.investmentBudget"/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                        <label style="font-weight:900;font-size:16px">可研阶段资料</label>
                                        </Col>
                                        <Col span="11">
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="预评价报告">
                                                <Input readonly type="text"  v-model="healthEvaluateReportFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthEvaluateReportFile.fileId,healthEvaluateReportFile.fileName,healthEvaluateReportFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="评价方案">
                                                <Input readonly type="text"  v-model="healthPreEvaluateProjectFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthPreEvaluateProjectFile.fileId,healthPreEvaluateProjectFile.fileName,healthPreEvaluateProjectFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="建设单位意见">
                                                <Input readonly type="text"  v-model="healthBuildUnitFile.name">
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthBuildUnitFile.fileId,healthBuildUnitFile.fileName,healthBuildUnitFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="专家组验收意见">
                                                <Input readonly type="text"  v-model="healthZJAcceptAdviceFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthZJAcceptAdviceFile.fileId,healthZJAcceptAdviceFile.fileName,healthZJAcceptAdviceFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="报告修改确认材料">
                                                <Input readonly type="text"  v-model="healthModifySureFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthModifySureFile.fileId,healthModifySureFile.fileName,healthModifySureFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                        <label style="font-weight:900;font-size:16px">设计阶段资料</label>
                                        </Col>
                                        <Col span="11">
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="防护设施设计文件">
                                                <Input readonly type="text"  v-model="healthProtectDesignFile.name">
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthProtectDesignFile.fileId,healthProtectDesignFile.fileName,healthProtectDesignFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="评价方案">
                                                <Input readonly type="text"  v-model="healthEvaluateProjectFile.name">
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthEvaluateProjectFile.fileId,healthEvaluateProjectFile.fileName,healthEvaluateProjectFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="建设单位意见">
                                                <Input readonly type="text"  v-model="healthBuildUnitAdviceFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthBuildUnitAdviceFile.fileId,healthBuildUnitAdviceFile.fileName,healthBuildUnitAdviceFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="专家组意见">
                                                <Input readonly type="text"  v-model="healthZJAdviceFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthZJAdviceFile.fileId,healthZJAdviceFile.fileName,healthZJAdviceFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="报告修改确认材料">
                                                <Input readonly type="text"  v-model="healthReportModifyFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(healthReportModifyFile.fileId,healthReportModifyFile.fileName,healthReportModifyFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                        </Col>
                                    </Row>
                                </Form>
                            </Card>
                            <Card>
                                <p slot="title">过程管理</p>
                                <Form  ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="职业卫生过程文件">
                                                <div v-show="healthProcessFiles.length>0" v-for="(item,index) in healthProcessFiles" :key='item'>
                                                    <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                                </div> 
                                            </FormItem>
                                        </Col>
                                        <Col span="11"></Col>
                                    </Row>
                                </Form>
                            </Card>
                        </Col>
                    </Row>        
                </TabPane>
                <TabPane label="安全三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isSafe=='1'" name="name4" style="height:500px;overflow-x:hidden;overflow-y:auto;">
                    <Row>
                        <Col span="24">
                            <Card>
                                <p slot="title">可研设计资料</p>
                                <Form  ref="threeSimSafeData" :model="threeSimSafeData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                        <label style="font-weight:900;font-size:16px">可研阶段资料</label>
                                        </Col>
                                        <Col span="11">
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="预评价报告编制单位：">
                                                <Input readonly type="text" v-model="threeSimSafeData.quotaUnit"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="预评价报告审查完成时间">
                                                <DatePicker type="date" placeholder="选择时间" v-model="threeSimSafeData.safeExamineFinishTime" style="width: 100%"></DatePicker>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="预评价报告">
                                                <Input readonly type="text"  v-model="safePreEvaluateReportFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(safePreEvaluateReportFile.fileId,safePreEvaluateReportFile.fileName,safePreEvaluateReportFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="预评价报告审查意见">
                                                <Input readonly type="text"  v-model="safePreEvaluateAdviceFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(safePreEvaluateAdviceFile.fileId,safePreEvaluateAdviceFile.fileName,safePreEvaluateAdviceFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                        <label style="font-weight:900;font-size:16px">设计阶段资料</label>
                                        </Col>
                                        <Col span="11">
                                        </Col>
                                    </Row>
                                    <br>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="安全设施设计单位">
                                                <Input readonly type="text" v-model="threeSimSafeData.designUnit"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="安全设施设计批复时间">
                                                <DatePicker type="date" placeholder="选择时间" v-model="threeSimSafeData.replyTime" style="width: 100%"></DatePicker>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="安全设施设计报告">
                                                <Input readonly type="text"  v-model="safeDesignReportFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(safeDesignReportFile.fileId,safeDesignReportFile.fileName,safeDesignReportFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="安全设施设计批复文件">
                                                <Input readonly type="text"  v-model="safeDesignReplyFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(safeDesignReplyFile.fileId,safeDesignReplyFile.fileName,safeDesignReplyFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                </Form>
                            </Card>
                            <Card>
                                <p slot="title">过程管理</p>
                                <Form  ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="安全过程文件">
                                                <div v-show="safeProcessFiles.length>0" v-for="(item,index) in safeProcessFiles" :key='item'>
                                                    <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                                </div> 
                                            </FormItem>
                                        </Col>
                                        <Col span="11"></Col>
                                    </Row>
                                </Form>
                            </Card>
                        </Col>
                    </Row>  
                </TabPane>
                <TabPane label="节能评估三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isEnergy=='1'" name="name5" style="height:500px;overflow-x:hidden;overflow-y:auto;">
                    <Row>
                        <Col span="24">
                            <Card>
                                <p slot="title">可研设计资料</p>
                                <Form  ref="threeSimSafeProcessData" :model="threeSimSafeProcessData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="节能报告编制单位">
                                                <Input readonly type="text" v-model="threeSimEnergyData.quotaUnit"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="股份公司内部审查时间">
                                                <DatePicker type="date" placeholder="选择时间" v-model="threeSimEnergyData.examineFinishTime" style="width: 100%"></DatePicker>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="股份公司内部审查节能报告">
                                                <Input readonly type="text"  v-model="energyReportFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(energyReportFile.fileId,energyReportFile.fileName,energyReportFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="股份公司内部审查纪要">
                                                <Input readonly type="text"  v-model="energySummaryFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(energySummaryFile.fileId,energySummaryFile.fileName,energySummaryFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="政府审查机构">
                                                <Input readonly type="text" v-model="threeSimEnergyData.examineUnit"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="地方政府审查节能报告">
                                                <Input readonly type="text"  v-model="energyLocalGovermentReportFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(energyLocalGovermentReportFile.fileId,energyLocalGovermentReportFile.fileName,energyLocalGovermentReportFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="优化措施实现节能量（吨标准煤）">
                                                <Input readonly type="text" v-model="threeSimEnergyData.economyEnergy"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="优化措施实现节约投资（万元）">
                                                <Input readonly type="text" v-model="threeSimEnergyData.economyInvestment"/>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="政府审查时间">
                                                <DatePicker type="date" placeholder="选择时间" v-model="threeSimEnergyData.governmentExamineTime" style="width: 100%"></DatePicker>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="地方政府审查批复文件">
                                                <Input readonly type="text"  v-model="energyLocalGovermentReplyFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(energyLocalGovermentReplyFile.fileId,energyLocalGovermentReplyFile.fileName,energyLocalGovermentReplyFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="优化措施实现节水量（万立方米）">
                                                <Input readonly type="text" v-model="threeSimEnergyData.economyWater"/>
                                            </FormItem>
                                        </Col>
                                        <Col span="11">
                                            <FormItem label="项目评估优化措施明细">
                                                <Input readonly type="text"  v-model="energyControlDetailFile.name" >
                                                    <Button type="ghost" slot="append" @click="downloadFile(energyControlDetailFile.fileId,energyControlDetailFile.fileName,energyControlDetailFile)">下载</Button>
                                                </Input>
                                            </FormItem>
                                        </Col>
                                    </Row>
                                </Form>
                            </Card>
                            <Card>
                                <p slot="title">过程管理</p>
                                <Form  ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="节能评估过程文件">
                                                <div v-show="energyProcessFiles.length>0" v-for="(item,index) in energyProcessFiles" :key='item'>
                                                    <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                                </div> 
                                            </FormItem>
                                        </Col>
                                        <Col span="11"></Col>
                                    </Row>
                                </Form>
                            </Card>
                        </Col>
                    </Row>          
                </TabPane>
                <TabPane label="消防三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isFire=='1'" name="name6" style="height:500px;overflow-x:hidden;overflow-y:auto;">
                    <Row>
                        <Col span="24">
                            <Card>
                                <p slot="title">可研设计资料</p>
                                <Form  ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="消防报告">
                                                <div v-show="fireReportFiles.length>0" v-for="(item,index) in fireReportFiles" :key='item'>
                                                    <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                                </div> 
                                            </FormItem>
                                        </Col>
                                        <Col span="11"></Col>
                                    </Row>
                                </Form>
                            </Card>
                            <Card>
                                <p slot="title">过程管理</p>
                                <Form  ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom" label-position="top">
                                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                                        <Col span="11">
                                            <FormItem label="消防过程文件">
                                                <div v-show="fireProcessFiles.length>0" v-for="(item,index) in fireProcessFiles" :key='item'>
                                                    <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                                                </div> 
                                            </FormItem>
                                        </Col>
                                        <Col span="11"></Col>
                                    </Row>
                                </Form>
                            </Card>
                        </Col>
                    </Row>
                </TabPane>
            </Tabs>
        </Modal>
    </layout>
</template>

<script>
    import {Api} from '../../../api/index.js'
    import cascaderDom from '../../../components/cascader-dom'
    import { mapState, mapGetters, mapActions } from 'vuex'
    import {sessionStorage} from '../../../common/cacheUtils.js';
    import pageCommonFunction from '@/components/pageCommonFunction.js'

    export default {
        components: {
            cascaderDom
        },
        data() {
            return {
                userEnableEdit:false,
                tabName:"",
                designData:{},
                designSureData:{},
                designSureVisible: false,
                giveVisible: false,
                queryParam: {projectName:"",dutyOrgName:'',projectLevel:'',projectNature:''},
                threeSimAccountVisible:false,
                environmentalDesignFile:{},
                environmentalInfluenceReportFile:{},
                environmentalInfluenceReplyFile:{},
                environmentalSoilWaterReportFile:{},
                environmentalSoilWaterPayProofFile:{},
                environmentalSoilWaterGovermentReplyFile:{},
                environmentalSoilWaterReplyFile:{},
                healthBuildUnitAdviceFile:{},
                healthBuildUnitFile:{},
                healthEvaluateProjectFile:{},
                healthPreEvaluateProjectFile:{},
                healthEvaluateReportFile:{},
                healthModifySureFile:{},
                healthProtectDesignFile:{},
                healthReportModifyFile:{},
                healthZJAdviceFile:{},
                healthZJAcceptAdviceFile:{},
                safeDesignReplyFile:{},
                safeDesignReportFile:{},
                safePreEvaluateAdviceFile:{},
                safePreEvaluateReportFile:{},
                energyControlDetailFile:{},
                energyLocalGovermentReplyFile:{},
                energyLocalGovermentReportFile:{},
                energyReportFile:{},
                energySummaryFile:{},
                threeSimEnvironmentalDatas:[{}],
                threeSimHealthData:{},
                threeSimEnergyData:{},
                threeSimSafeData:{},
                environReceiveFile:{},
                environWaterSoilDetectionFile:{},
                environReceiveRecordFile:{},
                environWaterSoilManageFile:{},
                environWaterSoilReceiveFile:{},
                environWaterSoilReceiveReplyFile:{},
                environDetectionFile:{},
                environManageReportFile:{},
                safeFacilityReceiveAdviceFile:{},
                safeFacilityReplyFile:{},
                safeReceiveEvaluateAdviceFile:{},
                safeReceiveEvaluateReportFile:{},
                healthBuildUnitAdviceFile:{},
                healthControlEvaluateFile:{},
                healthMaterialFile:{},
                healthReceiveReportFile:{},
                healthReceiveWorkFile:{},
                healthReportModifyAndReceiveFile:{},
                healthZJGroupFile:{},
                energyLocalGovermentReceiveAdviceFile:{},
                energyReceiveReportFile:{},
                threeSimEnvironmentalProcessData:{},
                threeSimHealthProcessData:{},
                threeSimEnergyProcessData:{},
                threeSimSafeProcessData:{},
                environmentalProcessFiles:[],
                healthProcessFiles:[],
                safeProcessFiles:[],
                energyProcessFiles:[],
                fireReportFiles:[],
                fireProcessFiles:[],
                environmentalVisible:false,
                healthVisible:false,
                safeVisible:false,
                energyVisible:false,
                fireVisible: false,
                threeSimEnvironmentalProcessData:{},
                threeSimHealthProcessData:{},
                threeSimEnergyProcessData:{},
                threeSimSafeProcessData:{},
                form1:{},
                isUpdate:false,
                switchFlag: false,
                projectLevelMaps:{},
                projectNatureMaps:{},
                projectNatures:[],
                projectLevels:[],
                projectNatures:[],
                pageSizeArray: [10, 20, 50],
                pagedata: {
                    total: 0,
                    pageSize: 10,
                    currentPage: 1,
                },
                columns1: [
                    {
                        width: 60,
                        align: 'center',
                        render:(h,params)=>{
                            return h('div',[
                                h('Checkbox',{
                                    props:{
                                        value:params.row.checkBox
                                    },
                                    on:{
                                        'on-change':(e)=>{
                                            this.dataTable.forEach((items)=>{      //先取消所有对象的勾选，checkBox设置为false
                                                this.$set(items,'checkBox',false)
                                            });
                                            if(e == true){
                                                this.dataTable[params.index].checkBox = e;  //再将勾选的对象的checkBox设置为true
                                                this.selectedInfo = this.dataTable[params.index];
                                            }else{
                                                this.selectedInfo = {};
                                            }
                                        }
                                    }
                                })
                            ])
                        }
                    },
                    {
                        title: "序号",
                        width: 80,
                        align: "center",
                        fixed: 'left',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata.currentPage - 1) * this.pagedata.pageSize + 1);
                        }
                    },
                    {
                        minWidth: 220,
                        title: '项目名称',
                        key: 'projectName',
                        align: 'center'
                    },
                    {
                        minWidth: 220,
                        title: '责任单位',
                        key: 'dutyOrgName',
                        align: 'center'
                    },
                    {
                        minWidth: 220,
                        title: '项目设计单位',
                        key: 'designUnit',
                        align: 'center'
                    },
                     {
                        minWidth: 220,
                        title: '项目性质',
                        key: 'projectNature',
                        align: 'center',
                        render:(h, params)=>{
                            return h('span', this.projectNatureMaps && this.projectNatureMaps[params.row.projectNature] && this.projectNatureMaps[params.row.projectNature].codingName)
                        },
                    },
                    {
                        minWidth: 220,
                        title: '项目级别',
                        key: 'projectLevel',
                        align: 'center',
                        render:(h, params)=>{
                            return h('span', this.projectLevelMaps && this.projectLevelMaps[params.row.projectLevel] && this.projectLevelMaps[params.row.projectLevel].codingName)
                        },
                    },
                    {
                        minWidth: 220,
                        title: '所在行政区域',
                        key: 'administrativeMap',
                        align: 'center',
                        render: (h, params) =>{ 
                            return h('span', this.areaCodeToAreaName(params.row.administrativeMap)); 
                        },
                    },
                    {
                        minWidth: 220,
                        title: '总投资（万元）',
                        key: 'totalInvestment',
                        align: 'center'
                    },
                    {
                        minWidth: 220,
                        title: '年综合能源消耗量（吨标准煤）',
                        key: 'powerConsumption',
                        align: 'center'
                    },
                    {
                        minWidth: 220,
                        title: '立项时间',
                        key: 'establishmentTime',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', this.formatDate(new Date(params.row.establishmentTime),"yyyy-MM-dd"));
                        }
                    },
                    {
                        minWidth: 130,
                        title: '计划开工时间',
                        key: 'startTime',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', this.formatDate(new Date(params.row.startTime),"yyyy-MM-dd"));
                        }
                    },
                    {
                        minWidth: 130,
                        title: '计划完工时间',
                        key: 'endTime',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', this.formatDate(new Date(params.row.endTime),"yyyy-MM-dd"));
                        }
                    },
                    {
                        minWidth: 130,
                        title: '环境',
                        key: 'checkCycle',
                        align: 'center',
                        render: (h, params) => {
                             return h('span', params.row.isEnvironmental=='1'?'√':'×');
                        }
                    },
                    {
                        minWidth: 130,
                        title: '职业卫生',
                        key: 'health',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.isHealth=='1'?'√':'×');
                        }
                    },
                    {
                        minWidth: 130,
                        title: '安全',
                        key: 'safe',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.isSafe=='1'?'√':'×');
                        }
                    },
                    {
                        minWidth: 130,
                        title: '节能评估',
                        key: 'energySaving',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.isEnergy=='1'?'√':'×');
                        }
                    },
                    {
                        minWidth: 130,
                        title: '消防',
                        key: 'fireProtection',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.isFire=='1'?'√':'×');
                        }
                    },
                    {
                        minWidth: 130,
                        title: '联系电话',
                        key: 'contactPhone',
                        align: 'center'
                    },
                    {
                        title: '操作',
                        key: 'action',
                        fixed: 'right',
                        minWidth: 200,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('A', {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    style: {
                                        fontSize: '14px',
                                    },
                                    on: {
                                        click: () => {
                                            this.dataTable.forEach((items)=>{      //先取消所有对象的勾选，checkBox设置为false
                                                this.$set(items,'checkBox',false)
                                            });
                                            this.dataTable[params.index].checkBox = true;  //再将勾选的对象的checkBox设置为true
                                            this.viewInfo(params.row);
                                        }
                                    }
                                }, '详情'),
                            ]);
                        }
                    }
                ],
                ruleCustom: {
                    planName: [{required: true, message: '  ', trigger: 'blur,change'}],
                    planDate: [{required: true, message: '  ', trigger: 'blur,change', pattern: /.+/ }],
                    screenOrgId: [{required: true, message: '  ', trigger: 'blur'}],
                    screenPositionId: [{required: true, message: '  ', trigger: 'blur'}]
                },
                ruleDesignSureCustom:{
                    receiveAdvice: [{required: true, message: '  ', trigger: 'blur,change'}],
                    receiveUserName: [{required: true, message: '  ', trigger: 'blur,change'}],
                    receiveTime: [{required: true, message: '  ', trigger: 'blur,change'}],
                },
                selectedInfo:{},
                modal1: false,
                add: false,
                titleName:'',
                loading: false,
                environmentalLoading:false,
                safeLoading:false,
                healthLoading:false,
                energyLoading:false,
                fireLoading:false,
                tableHeight: '',
                dataTable: [],
                showdata:{},
                currentUser: sessionStorage('userId').getObject('userId'),
                currentUserId: sessionStorage('userId').getObject('userId').userId,
                rootOrgId:''
            }
        },
        async mounted(){
            this.rootOrgId =  sessionStorage('userId').getObject('userId').companyId;
            this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 145;
            await this.$store.dispatch('trhg/area/query', {scope:this}, { root: true });
            this.query();
            this.$http.get(Api.queryCodeDetailBySortId + '/STS-000001', {params: {}}).then((res) => {
                this.projectLevelMaps = this.dictListToMap(res.data.data);
                this.projectLevels = res.data.data;
            });
            this.$http.get(Api.queryCodeDetailBySortId + '/STS-000002', {params: {}}).then((res) => {
                this.projectNatureMaps = this.dictListToMap(res.data.data);
                this.projectNatures = res.data.data;
            });
        },
        computed:{
            ...mapState('trhg', {
                areaTree: state => state.area.areaTree?state.area.areaTree:[],
                areaMap: state => state.area.areaMap?state.area.areaMap:[],
            }),
        },
        methods: {
            ...pageCommonFunction,
            selectedChanged(row){   
                this.selectedInfo = row;
            },
            async beforeUploadFire(file) {
                await this.uploadFile(file,"fire_Process","report");
                this.queryFireProcess(false);
                return false;
            },
            removeFireProcessFile(id) {
                if(id == ""){
                    this.fireProcessFiles = [];
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.queryFireProcess(false);
                    })
                }
            },
            async beforeUploadEnergy(file) {
                await this.uploadFile(file,"energy_Process","report");
                this.queryEnergyProcess(false);
                return false;
            },
            removeEnergyProcessFile(id) {
                if(id == ""){
                    this.energyProcessFiles = [];
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.queryEnergyProcess(false);
                    })
                }
            },
            async beforeUploadSafe(file) {
                await this.uploadFile(file,"safe_Process","report");
                this.querySafeProcess(false);
                return false;
            },
            removeSafeProcessFile(id) {
                if(id == ""){
                    this.safeProcessFiles = [];
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.querySafeProcess(false);
                    })
                }
            },
            async beforeUploadHealth(file) {
                await this.uploadFile(file,"health_Process","report");
                this.queryHealthProcess(false);
                return false;
            },
            removeHealthProcessFile(id) {
                if(id == ""){
                    this.healthProcessFiles = [];
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.queryHealthProcess(false);
                    })
                }
            },
            async beforeUploadEnvironmental(file) {
                await this.uploadFile(file,"environmental_Process","report");
                this.queryEnvironmentalProcess(false);
                return false;
            },
            removeEnvironmentalProcessFile(id) {
                if(id == ""){
                    this.environmentalProcessFiles = [];
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.queryEnvironmentalProcess(false);
                    })
                }
            },
            downloadFile(fileId,fileName,file){
                if(fileId != undefined && fileId != 'undefined' && fileId != ''){
                    let url = Api.singlePicture + "/" + fileId
                    this.$http.get(url, {
                        responseType: 'blob'      //告诉服务器我们需要的响应格式
                    }).then((res) => {
                        const aLink = document.createElement("a");
                        let blob = new Blob([res.data], {
                            type: res.body.type      //将会被放入到blob中的数组内容的MIME类型
                        });
                        aLink.href = URL.createObjectURL(blob)
                        aLink.download = fileName //标题
                        aLink.click()
                        document.body.appendChild(aLink)
                    })
                }else{
                    let aTag = document.createElement('a');//创建一个a标签
                    aTag.download = file.name;
                    let href = URL.createObjectURL(file);//获取url
                    aTag.href = href;
                    aTag.click();
                    URL.revokeObjectURL(href);//释放url
                }
            },
            submitDesignData(name){
                let url = Api.threeSimDesignGive;
                this.designData.transferType = 'Process';
                this.$http.post(url, this.designData).then((res) => {
                    if(res.data.status == 200){
                        this.$Message.success('成功');
                        this.query()
                        this.giveVisible = false
                    }else{
                        this.$Message.error('请求失败');
                    }
                }).catch(e => {
                    this.$Message.error('请求失败');
                })
            },
            submitDesignSureData(name){
                let url = Api.threeSimDesignGive;
                this.$http.put(url, this.designSureData).then((res) => {
                    if(res.data.status == 200){
                        this.$Message.success('成功');
                        this.query()
                        this.designSureVisible = false
                    }else{
                        this.$Message.error('请求失败');
                    }
                }).catch(e => {
                    this.$Message.error('请求失败');
                })
            },
            giveTo(row){
                this.designData = {};
                this.designData.projectId = row.projectId;
                this.giveVisible = true;
            },
            query(){
                this.selectedInfo = {};
                this.loading = true;
                let user = sessionStorage('userId').getObject('userId');
                let data = {
                    startPage: this.pagedata.currentPage,
                    size: this.pagedata.pageSize,
                    companyId: user.companyId
                }
                data = Object.assign(data,JSON.parse(JSON.stringify(this.queryParam)));
                this.$http.get(Api.threeSimProjectList, {
                    params: data
                }).then(function(res){
                    if(res.data.status == 200){
                        this.dataTable = res.data.data.data;
                        this.pagedata.total = res.data.data.totalSize;
                    }
                    this.loading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                    this.loading = false;
                });
            },
            submit(name,type) {
                this.$refs[name].validate((valid) => {
                    if (valid) {
                        if(type == 'environmental_Process'){
                            this.buttonLoading = true
                            if (this.isUpdate) {
                                let url = Api.threeSimEnvironmentalProcess
                                this.$http.put(url, this.threeSimEnvironmentalProcessData).then((res) => {
                                    if(res.data.status == 200){
                                        this.$Message.success('成功');
                                        this.query()
                                        this.buttonLoading = false
                                        this.environmentalVisible = false
                                    }else{
                                        this.$Message.error('请求失败');
                                    }
                                }).catch(e => {
                                    this.$Message.error('请求失败');
                                })
                            } else {
                                let url = Api.threeSimEnvironmentalProcess;
                                this.$http.post(url, this.threeSimEnvironmentalProcessData).then((res) => {
                                    if(res.data.status == 200){
                                        this.$Message.success('成功');
                                        this.query()
                                        this.buttonLoading = false
                                        this.environmentalVisible = false
                                    }else{
                                        this.$Message.error('请求失败');
                                    }
                                }).catch(e => {
                                    this.$Message.error('请求失败');
                                })
                            }
                        }
                        if(type == 'health_Process'){
                            this.healthVisible = false
                        }
                        if(type == 'safe_Process'){
                            this.buttonLoading = true
                            if (this.isUpdate) {
                                let url = Api.threeSimSafeProcess
                                this.$http.put(url, this.threeSimSafeProcessData).then((res) => {
                                    if(res.data.status == 200){
                                        this.$Message.success('成功');
                                        this.query()
                                        this.buttonLoading = false
                                        this.safeVisible = false
                                    }else{
                                        this.$Message.error('请求失败');
                                    }
                                }).catch(e => {
                                    this.$Message.error('请求失败');
                                })
                            } else {
                                let url = Api.threeSimSafeProcess;
                                this.$http.post(url, this.threeSimSafeProcessData).then((res) => {
                                    if(res.data.status == 200){
                                        this.$Message.success('成功');
                                        this.query()
                                        this.buttonLoading = false
                                        this.safeVisible = false
                                    }else{
                                        this.$Message.error('请求失败');
                                    }
                                }).catch(e => {
                                    this.$Message.error('请求失败');
                                })
                            }
                        }
                        if(type == 'energy_Process'){
                            this.buttonLoading = true
                            if (this.isUpdate) {
                                let url = Api.threeSimEnergyProcess
                                this.$http.put(url, this.threeSimEnergyProcessData).then((res) => {
                                    if(res.data.status == 200){
                                        this.$Message.success('成功');
                                        this.query()
                                        this.buttonLoading = false
                                        this.energyVisible = false
                                    }else{
                                        this.$Message.error('请求失败');
                                    }
                                }).catch(e => {
                                    this.$Message.error('请求失败');
                                })
                            } else {
                                let url = Api.threeSimEnergyProcess;
                                this.$http.post(url, this.threeSimEnergyProcessData).then((res) => {
                                    if(res.data.status == 200){
                                        this.$Message.success('成功');
                                        this.query()
                                        this.buttonLoading = false
                                        this.energyVisible = false
                                    }else{
                                        this.$Message.error('请求失败');
                                    }
                                }).catch(e => {
                                    this.$Message.error('请求失败');
                                })
                            }
                        }
                    }
                })
            },
            pageSizeChange(pageSize){
                this.pagedata.pageSize = pageSize;
                this.query();
            },
            pageChange(pageNum){
                this.pagedata.currentPage = pageNum;
                this.query();
            },
            reset(){
                this.queryParam =  {projectName:"",dutyOrgName:'',projectLevel:'',projectNature:''}
                this.query();
            },
            onCancel(){
                this.environmentalVisible = false;
                this.healthVisible = false;
                this.safeVisible = false;
                this.energyVisible = false;
                this.giveVisible = false;
                this.designSureVisible = false;
                this.fireVisible = false;
            },
            switchQuery(flag){
                this.switchFlag = flag;
                if (!this.switchFlag) {
                    this.tableHeight = this.tableHeight + 44;
                } else {
                    this.tableHeight = this.tableHeight - 44;
                }
            },
            designSureClick(){
                this.designSureData = JSON.parse(JSON.stringify(this.selectedInfo.threeSimTransfer));
                this.designSureData.receiveUserName = sessionStorage('userId').getObject('userId').userName;
                this.designSureData.receiveUserId = sessionStorage('userId').getObject('userId').userId;
                this.designSureData.receiveTime = this.formatDate(new Date(),"yyyy-MM-dd");
                this.designSureVisible = true;
            },
            queryEnvironmental(){
                this.environmentalDesignFile = {};
                this.environmentalInfluenceReportFile = {},
                this.environmentalInfluenceReplyFile = {},
                this.environmentalSoilWaterReportFile = {},
                this.environmentalSoilWaterPayProofFile = {},
                this.environmentalSoilWaterGovermentReplyFile = {},
                this.environmentalSoilWaterReplyFile = {},
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=environmental").then(function(res){
                    res.data.data.forEach(item=>{
                        if(item.field == "report"){
                            this.environmentalDesignFile = item;
                        }
                        if(item.field == "influenceReport"){
                            this.environmentalInfluenceReportFile = item;
                        }
                        if(item.field == "influenceReply"){
                            this.environmentalInfluenceReplyFile = item;
                        }
                        if(item.field == "soilWaterReport"){
                            this.environmentalSoilWaterReportFile = item;
                        }
                        if(item.field == "soilWaterPayProof"){
                            this.environmentalSoilWaterPayProofFile = item;
                        }
                        if(item.field == "soilWaterGovermentReply"){
                            this.environmentalSoilWaterGovermentReplyFile = item;
                        }
                        if(item.field == "soilWaterReply"){
                            this.environmentalSoilWaterReplyFile = item;
                        }
                    })
                }, function(res){
                    this.$Message.error('请求失败');
                    this.loading = false;
                });
                this.$http.get(Api.getEnvironmentalsByProjectId + "/" + this.selectedInfo.projectId).then(function(res){
                    if(res.data.data.length == 0){
                        this.threeSimEnvironmentalDatas = [{
                                projectId: this.selectedInfo.projectId,
                                createUserId: this.currentUser.userId,
                                createOrgId:this.currentUser.orgInfo.orgId,         
                                createDate: new Date(),
                                createDateStr: this.formatDate(new Date()),
                                bsflag:'0',
                                environmentType:'0',
                                environmentTypeName:'环境影响评价',
                                remark:''
                            },  
                            {
                                projectId: this.selectedInfo.projectId,
                                createUserId: this.currentUser.userId,
                                createOrgId:this.currentUser.orgInfo.orgId,         
                                createDate: new Date(),
                                createDateStr: this.formatDate(new Date()),
                                bsflag:'0',
                                environmentType:'1',
                                environmentTypeName:'环保竣工验收',
                                remark:''
                            },  
                            {
                                projectId: this.selectedInfo.projectId,
                                createUserId: this.currentUser.userId,
                                createOrgId:this.currentUser.orgInfo.orgId,         
                                createDate: new Date(),
                                createDateStr: this.formatDate(new Date()),
                                bsflag:'0',
                                environmentType:'2',
                                environmentTypeName:'水土保持评价',
                                remark:''
                            },  
                            {
                                projectId: this.selectedInfo.projectId,
                                createUserId: this.currentUser.userId,
                                createOrgId:this.currentUser.orgInfo.orgId,         
                                createDate: new Date(),
                                createDateStr: this.formatDate(new Date()),
                                bsflag:'0',
                                environmentType:'3',
                                environmentTypeName:'水土保持验收',
                                remark:''
                            },    
                        ]
                    }else{
                        this.threeSimEnvironmentalDatas =  res.data.data;
                        this.threeSimEnvironmentalDatas.forEach(item=>{
                            if(item.environmentType=="0"){
                                item.environmentTypeName = "环境影响评价"
                            }
                            if(item.environmentType=="1")
                                item.environmentTypeName = "环保竣工验收"
                            if(item.environmentType=="2")
                                item.environmentTypeName = "水土保持评价"
                            if(item.environmentType=="3")
                                item.environmentTypeName = "水土保持验收"
                        })
                    }
                }, function(res){
                    this.$Message.error('请求失败');
                    this.loading = false;
                });
            },
            queryHealth(){
                this.healthBuildUnitFile = {};
                this.healthEvaluateProjectFile = {};
                this.healthBuildUnitAdviceFile = {};
                this.healthEvaluateReportFile = {};
                this.healthModifySureFile = {};
                this.healthPreEvaluateProjectFile = {};
                this.healthProtectDesignFile = {};
                this.healthReportModifyFile = {};
                this.healthZJAcceptAdviceFile = {"name":""};
                this.healthZJAdviceFile = {"name":""};
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=health").then(function(res){
                    res.data.data.forEach(item=>{
                        if(item.field == "buildUnit"){
                            this.healthBuildUnitFile = item;
                        }
                        if(item.field == "evaluateProject"){
                            this.healthEvaluateProjectFile = item;
                        }
                        if(item.field == "buildUnitAdvice"){
                            this.healthBuildUnitAdviceFile = item;
                        }
                        if(item.field == "evaluateReport"){
                            this.healthEvaluateReportFile = item;
                        }
                        if(item.field == "modifySure"){
                            this.healthModifySureFile = item;
                        }
                        if(item.field == "preEvaluateProject"){
                            this.healthPreEvaluateProjectFile = item;
                        }
                        if(item.field == "protectDesign"){
                            this.healthProtectDesignFile = item;
                        }
                        if(item.field == "reportModify"){
                            this.healthReportModifyFile = item;
                        }
                        if(item.field == "zjAcceptAdvice"){
                            this.healthZJAcceptAdviceFile = item;
                        }
                        if(item.field == "zjAdvice"){
                            this.healthZJAdviceFile = item;
                        }
                    })
                }, function(res){
                    this.$Message.error('请求失败');
                    this.loading = false;
                });
                this.$http.get(Api.getHealthByProjectId + "/" + this.selectedInfo.projectId).then(function(res){
                    if(res.data.data.length == 0){
                        this.threeSimHealthData = {
                            projectId: this.selectedInfo.projectId
                        }
                    }else{
                        this.threeSimHealthData = res.data.data[0];
                    }
                });
            },
            querySafe(){
                this.safeDesignReplyFile = {};
                this.safeDesignReportFile = {};
                this.safePreEvaluateAdviceFile = {};
                this.safePreEvaluateReportFile = {};
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=safe").then(function(res){
                    res.data.data.forEach(item=>{
                        if(item.field == "designReply"){
                            this.safeDesignReplyFile = item;
                        }
                        if(item.field == "designReport"){
                            this.safeDesignReportFile = item;
                        }
                        if(item.field == "preEvaluateAdvice"){
                            this.safePreEvaluateAdviceFile = item;
                        }
                        if(item.field == "preEvaluateReport"){
                            this.safePreEvaluateReportFile = item;
                        }
                    })
                }, function(res){
                    this.$Message.error('请求失败');
                    this.loading = false;
                });
                this.$http.get(Api.getSafeByProjectId + "/" + this.selectedInfo.projectId).then(function(res){
                    if(res.data.data.length == 0){
                        this.threeSimSafeData = {
                            projectId: this.selectedInfo.projectId
                        }
                    }else{
                        this.threeSimSafeData = res.data.data[0];
                    }
                });
            },
            queryEnergy(){
                this.energyControlDetailFile = {};
                this.energyLocalGovermentReplyFile = {};
                this.energyReportFile = {};
                this.energyLocalGovermentReportFile = {};
                this.energySummaryFile = {};
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=energy").then(function(res){
                    res.data.data.forEach(item=>{
                        if(item.field == "controlDetail"){
                            this.energyControlDetailFile = item;
                        }
                        if(item.field == "localGovermentReply"){
                            this.energyLocalGovermentReplyFile = item;
                        }
                        if(item.field == "report"){
                            this.energyReportFile = item;
                        }
                        if(item.field == "localGovermentReport"){
                            this.energyLocalGovermentReportFile = item;
                        }
                        if(item.field == "summary"){
                            this.energySummaryFile = item;
                        }
                    })
                }, function(res){
                    this.$Message.error('请求失败');
                    this.loading = false;
                });
                this.$http.get(Api.getEnergyByProjectId + "/" + this.selectedInfo.projectId).then(function(res){
                    if(res.data.data.length == 0){
                        this.threeSimEnergyData = {
                            projectId: this.selectedInfo.projectId
                        }
                    }else{
                        this.threeSimEnergyData = res.data.data[0];
                    }
                });
            },
            queryEnvironmentalProcess(view){
                this.environmentalLoading = true;
                this.environmentalProcessFiles= [];
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=environmental_Process").then(function(res){
                    res.data.data.forEach(item=>{
                        this.environmentalProcessFiles.push(item);
                    })
                    if(view){
                        this.environmentalVisible = true;
                    }
                    this.environmentalLoading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                    this.environmentalLoading = false;
                });
            },
            queryHealthProcess(view){
                this.healthLoading = true;
                if(view){
                    this.healthVisible = true;
                }
                this.healthProcessFiles= [];
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=health_Process").then(function(res){
                    res.data.data.forEach(item=>{
                        this.healthProcessFiles.push(item);   
                    })
                    this.healthLoading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                    this.healthLoading = false;
                });
            },
            querySafeProcess(view){
                this.safeLoading = true;
                if(view){
                    this.safeVisible = true;
                }
                this.safeProcessFiles = [];
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=safe_Process").then(function(res){
                    res.data.data.forEach(item=>{
                        this.safeProcessFiles.push(item);
                    })
                    this.safeLoading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                    this.safeLoading = false;
                });
            },
            queryEnergyProcess(view){
                this.energyLoading = true;
                if(view){
                    this.energyVisible = true;
                }
                this.energyProcessFiles= [];
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=energy_Process").then(function(res){
                    res.data.data.forEach(item=>{
                        this.energyProcessFiles.push(item);
                    })
                    this.energyLoading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                    this.energyLoading = false;
                });
            },
            queryFireProcess(view){
                this.fireLoading = true;
                this.fireProcessFiles = [];
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=fire_Process").then(function(res){
                    res.data.data.forEach(item=>{
                        if(item.field == "report"){
                            this.fireProcessFiles.push(item);
                        }
                    })
                    if(view){
                        this.fireVisible = true;
                    }
                    this.fireLoading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                    this.fireLoading = false;
                });
            },
            queryFire(view){
                this.fireLoading = true;
                this.fireReportFiles=[];
                this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=fire").then(function(res){
                    res.data.data.forEach(item=>{
                        if(item.field == "report"){
                            this.fireReportFiles.push(item);
                        }
                    })
                    this.fireLoading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                    this.fireLoading = false;
                });
            },
            uploadEnvironDetectionFile(file){
                this.environDetectionFile = file;
                this.environDetectionFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","detection")
                return false;
            },
            uploadEnvironManageReportFile(file){
                this.environManageReportFile = file;
                this.environManageReportFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","manageReport")
                return false;
            },
            uploadEnvironReceiveFile(file){
                this.environReceiveFile = file;
                this.environReceiveFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","receive")
                return false;
            },
            uploadEnvironReceiveRecordFile(file){
                this.environReceiveRecordFile = file;
                this.environReceiveRecordFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","receiveRecord")
                return false;
            },
            uploadEnvironWaterSoilDetectionFile(file){
                this.environWaterSoilDetectionFile = file;
                this.environWaterSoilDetectionFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","waterSoilDetection")
                return false;
            },
            uploadEnvironWaterSoilManageFile(file){
                this.environWaterSoilManageFile = file;
                this.environWaterSoilManageFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","waterSoilManage")
                return false;
            },
            uploadEnvironWaterSoilReceiveFile(file){
                this.environWaterSoilReceiveFile = file;
                this.environWaterSoilReceiveFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","waterSoilReceive")
                return false;
            },
            uploadEnvironWaterSoilReceiveReplyFile(file){
                this.environWaterSoilReceiveReplyFile = file;
                this.environWaterSoilReceiveReplyFile.fileName = file.name;
                this.uploadFile(file,"environmental_Process","waterSoilReceiveReply")
                return false;
            },
            uploadSafeFacilityReceiveAdviceFile(file){
                this.safeFacilityReceiveAdviceFile = file;
                this.safeFacilityReceiveAdviceFile.fileName = file.name;
                this.uploadFile(file,"safe_Process","facilityReceiveAdvice")
                return false;
            },
            uploadSafeFacilityReplyFile(file){
                this.safeFacilityReplyFile = file;
                this.safeFacilityReplyFile.fileName = file.name;
                this.uploadFile(file,"safe_Process","facilityReply")
                return false;
            },
            uploadSafeReceiveEvaluateAdviceFile(file){
                this.safeReceiveEvaluateAdviceFile = file;
                this.safeReceiveEvaluateAdviceFile.fileName = file.name;
                this.uploadFile(file,"safe_Process","receiveEvaluateAdvice")
                return false;
            },
            uploadSafeReceiveEvaluateReportFile(file){
                this.safeReceiveEvaluateReportFile = file;
                this.safeReceiveEvaluateReportFile.fileName = file.name;
                this.uploadFile(file,"safe_Process","receiveEvaluateReport")
                return false;
            },
            uploadEnergyReceiveReportFile(file){
                this.energyReceiveReportFile = file;
                this.energyReceiveReportFile.fileName = file.name;
                this.uploadFile(file,"energy_Process","receiveReport")
                return false;
            },
            uploadEnergyLocalGovermentReceiveAdviceFile(file){
                this.energyLocalGovermentReceiveAdviceFile = file;
                this.energyLocalGovermentReceiveAdviceFile.fileName = file.name;
                this.uploadFile(file,"energy_Process","localGovermentReceiveAdvice")
                return false;
            },
            uploadHealthBuildUnitAdviceFile(file){
                this.healthBuildUnitAdviceFile = file;
                this.healthBuildUnitAdviceFile.fileName = file.name;
                this.uploadFile(file,"health_Process","localGovermentReceiveAdvice")
                return false;
            },
            uploadHealthControlEvaluateFile(file){
                this.healthControlEvaluateFile = file;
                this.healthControlEvaluateFile.fileName = file.name;
                this.uploadFile(file,"health_Process","controlEvaluate")
                return false;
            },
            uploadHealthMaterialFile(file){
                this.healthMaterialFile = file;
                this.healthMaterialFile.fileName = file.name;
                this.uploadFile(file,"health_Process","material")
                return false;
            },
            uploadHealthReceiveReportFile(file){
                this.healthReceiveReportFile = file;
                this.healthReceiveReportFile.fileName = file.name;
                this.uploadFile(file,"health_Process","receiveReport")
                return false;
            },
            uploadHealthReceiveWorkFile(file){
                this.healthReceiveWorkFile = file;
                this.healthReceiveWorkFile.fileName = file.name;
                this.uploadFile(file,"health_Process","receiveWork")
                return false;
            },
            uploadHealthReportModifyAndReceiveFile(file){
                this.healthReportModifyAndReceiveFile = file;
                this.healthReportModifyAndReceiveFile.fileName = file.name;
                this.uploadFile(file,"health_Process","reportModifyAndReceive")
                return false;
            },
            uploadHealthZJGroupFile(file){
                this.healthZJGroupFile = file;
                this.healthZJGroupFile.fileName = file.name;
                this.uploadFile(file,"health_Process","zjGroup")
                return false;
            },
            uploadFireProcessReportFile(file){
                this.fireProcessReportFile = file;
                this.uploadFile(file,"fire_Process","report")
                return false;
            },
            deleteEnvironReceiveFile(id){
                if(id == ""){
                    this.environReceiveFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environReceiveFile = {"name":""};
                    })
                }
            },
            deleteEnvironDetectionFile(id){
                if(id == ""){
                    this.environDetectionFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environDetectionFile = {"name":""};
                    })
                }
            },
            deleteEnvironManageReportFile(id){
                if(id == ""){
                    this.environManageReportFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environManageReportFile = {"name":""};
                    })
                }
            },
            deleteEnvironReceiveRecordFile(id){
                if(id == ""){
                    this.environReceiveRecordFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environReceiveRecordFile = {"name":""};
                    })
                }
            },
            deleteEnvironWaterSoilDetectionFile(id){
                if(id == ""){
                    this.environWaterSoilDetectionFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environWaterSoilDetectionFile = {"name":""};
                    })
                }
            },
            deleteEnvironWaterSoilManageFile(id){
                if(id == ""){
                    this.environWaterSoilManageFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environWaterSoilManageFile = {"name":""};
                    })
                }
            },
            deleteEnvironWaterSoilReceiveFile(id){
                if(id == ""){
                    this.environWaterSoilReceiveFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environWaterSoilReceiveFile = {"name":""};
                    })
                }
            },
            deleteEnvironWaterSoilReceiveReplyFile(id){
                if(id == ""){
                    this.environWaterSoilReceiveReplyFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.environWaterSoilReceiveReplyFile = {"name":""};
                    })
                }
            },
            deleteHealthBuildUnitAdviceFile(id){
                if(id == ""){
                    this.healthBuildUnitAdviceFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.healthBuildUnitAdviceFile = {"name":""};
                    })
                }
            },
            deleteHealthControlEvaluateFile(id){
                if(id == ""){
                    this.healthControlEvaluateFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.healthControlEvaluateFile = {"name":""};
                    })
                }
            },
            deleteHealthMaterialFile(id){
                if(id == ""){
                    this.healthMaterialFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.healthMaterialFile = {"name":""};
                    })
                }
            },
            deleteHealthReceiveReportFile(id){
                if(id == ""){
                    this.healthReceiveReportFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.healthReceiveReportFile = {"name":""};
                    })
                }
            },
            deleteHealthReceiveWorkFile(id){
                if(id == ""){
                    this.healthReceiveWorkFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.healthReceiveWorkFile = {"name":""};
                    })
                }
            },
            deleteHealthReportModifyAndReceiveFile(id){
                if(id == ""){
                    this.healthReportModifyAndReceiveFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.healthReportModifyAndReceiveFile = {"name":""};
                    })
                }
            },
            deleteHealthZJGroupFile(id){
                if(id == ""){
                    this.healthZJGroupFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.healthZJGroupFile = {"name":""};
                    })
                }
            },
            deleteSafeFacilityReceiveAdviceFile(id){
                if(id == ""){
                    this.safeFacilityReceiveAdviceFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.safeFacilityReceiveAdviceFile = {"name":""};
                    })
                }
            },
            deleteSafeFacilityReplyFile(id){
                if(id == ""){
                    this.safeFacilityReplyFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.safeFacilityReplyFile = {"name":""};
                    })
                }
            },
            deleteSafeReceiveEvaluateAdviceFile(id){
                if(id == ""){
                    this.safeReceiveEvaluateAdviceFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.safeReceiveEvaluateAdviceFile = {"name":""};
                    })
                }
            },
            deleteSafeReceiveEvaluateReportFile(id){
                if(id == ""){
                    this.safeReceiveEvaluateReportFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.safeReceiveEvaluateReportFile = {"name":""};
                    })
                }
            },
            deleteEnergyLocalGovermentReceiveAdviceFile(id){
                if(id == ""){
                    this.energyLocalGovermentReceiveAdviceFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.energyLocalGovermentReceiveAdviceFile = {"name":""};
                    })
                }
            },
            deleteEnergyReceiveReportFile(id){
                if(id == ""){
                    this.energyReceiveReportFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.energyReceiveReportFile = {"name":""};
                    })
                }
            },
            deleteFireProcessReportFile(id){
                if(id == ""){
                    this.fireProcessReportFile = {"name":""};
                }else{
                    let url = Api.singlePicture + '/' + id;
                    this.$http.delete(url).then((res) => {
                        this.fireProcessReportFile = {"name":""};
                    })
                }
            },
            viewInfo(row){
                this.tabName = "";
                this.showdata = row;
                this.selectedInfo = row;
                this.showdata.projectType = [];
                if( this.showdata.isEnergy == '1')
                    this.showdata.projectType.push('4')
                if( this.showdata.isEnvironmental == '1')
                    this.showdata.projectType.push('1')
                if( this.showdata.isHealth == '1')
                    this.showdata.projectType.push('2')
                if( this.showdata.isSafe == '1')
                    this.showdata.projectType.push('3')
                if( this.showdata.isFire == '1')
                    this.showdata.projectType.push('5')
                this.showdata.establishmentTimeStr = this.formatDate(new Date(this.showdata.establishmentTime),"yyyy-MM-dd");
                this.showdata.startTimeStr = this.formatDate(new Date(this.showdata.startTime),"yyyy-MM-dd");
                this.showdata.endTimeStr = this.formatDate(new Date(this.showdata.endTime),"yyyy-MM-dd");
                if(this.projectNatureMaps && this.showdata.projectNature){
                    this.showdata.projectNatureName = this.projectNatureMaps[this.showdata.projectNature].codingName;
                }
                if(this.projectLevelMaps && this.showdata.projectLevel){
                    this.showdata.projectLevelName = this.projectLevelMaps[this.showdata.projectLevel].codingName;
                }
                this.threeSimAccountVisible = true;
                this.queryEnergy(false);
                this.queryHealth(false);
                this.queryEnvironmental(false);
                this.querySafe(false);
                this.queryFire(false);
                this.queryEnergyProcess(false);
                this.queryHealthProcess(false);
                this.queryEnvironmentalProcess(false);
                this.querySafeProcess(false);
                this.queryFireProcess(false);
            },
            setOrgId(data) {
                this.dataToQuery.orgId= data[data.length - 1];
            },
            setOrgName(data) {
                this.dataToQuery.orgName = data;
            },
            async uploadFile(file,type,field){
                let formData = new FormData();
                formData.append("file", file); // 文件对象
                formData.append("type",type);
                formData.append("field",field);
                let url = Api.singlePicture + '/' + this.selectedInfo.projectId;
                await this.$http.post(url, formData).then((res) => {
                    if (res.data.result == "success") {
                        this.$Message.info("文件上传成功")
                    }
                });
            },
            deleteInfo(row){
                this.$Modal.confirm({
                    title: '数据删除',
                    content: '<p>确定删除该条信息</p>',
                    okText: '确认',
                    onOk: () => {
                        this.$http.delete(Api.threeSimProject + "/" + row.projectId, {params:{
                                updateUserId: this.currentUser.userId
                            }}).then((res) => {
                            this.$Message.success({content:'删除成功',duration: 4});
                            this.query();
                        })
                    },
                    cancelText: '取消'
                });
            },
            queryProjectNatureList(){
                this.$http.get(Api.projectNatureMaps).then((res) => {
                    if(res.data.status == 200){
                        this.projectNatureMaps = res.data.data;
                    }
                }).catch(e => {
                    this.$Message.error("附件删除失败");
                });
            },
            queryProjectLevelList(){
                this.$http.get(Api.projectLevelMaps).then((res) => {
                    if(res.data.status == 200){
                        this.projectLevelMaps = res.data.data;
                    }
                }).catch(e => {
                    this.$Message.error("附件删除失败");
                });
            },
            formatDate(date, fmt) {
                if (typeof date == 'string') {
                    return date;
                }
                if (!fmt) fmt = "yyyy-MM-dd hh:mm:ss";
                if (!date || date == null) return null;
                let o = {
                    'M+': date.getMonth() + 1, // 月份
                    'd+': date.getDate(), // 日
                    'h+': date.getHours(), // 小时
                    'm+': date.getMinutes(), // 分
                    's+': date.getSeconds(), // 秒
                    'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
                    'S': date.getMilliseconds() // 毫秒
                }
                if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
                for (let k in o) {
                    if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
                }
                return fmt
            },
            uuid() {
                let s = [];
                let hexDigits = "0123456789abcdef";
                for(let i = 0; i < 32; i++) {
                    s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
                }
                s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
                s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
                let uuid = s.join("");
                return uuid
            },
        }
    }
</script>


<style scoped>
@import '../../../index.css';

.limit-height-dialog >>> .ivu-input-icon {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 16px;
    text-align: center;
    color: #808695;
    position: absolute;
    right: 0;
    z-index: 3;
    padding-right: 80px;
}

</style>